package FishandLake;

public class FishandLake {
	public static void main(String[] args) {
		Fish cuicuisha = new Fish();
		System.out.println(cuicuisha.weight);// 输出1
		Lake taihu = new Lake();
		Lake lake1 = new Lake();
		Lake lake2 = new Lake();
		lake1.setFish(cuicuisha);
		lake2.setFish(cuicuisha);
		taihu.setFish(cuicuisha);
		taihu.eat(15);
		System.out.println(cuicuisha.weight);// 输出2
		System.out.println(lake1.fish.weight);// 输出3
		System.out.println(lake2.fish.weight);// 输出4
		taihu.eat(100); // 调用实例对象taihu的eat方法修改鱼的重量
		System.out.println(taihu.fish.weight);// 输出5
		System.out.println(lake2.fish.weight);// 输出5
	}
}